<?php
/**
 * I know no such things as genius,it is nothing but labor and diligence.
 */

namespace app\common\contract;

/**
 * Interface UserInterface
 *
 * @package app\common\interfaces
 */
interface UserInterface{

	/**
	 * 获取用户信息
	 *
	 * @param string $field
	 * @param mixed  $default
	 * @param bool   $abort
	 * @return mixed
	 */
	public function get($field = null, $default = null, $abort = true);

	/**
	 * 获取用户id
	 *
	 * @param bool $abort
	 * @return int
	 */
	public function getId($abort = true);

	/**
	 * 设置用户信息
	 *
	 * @param array $info
	 * @return mixed
	 */
	public function set($info);

	/**
	 * 更新用户信息-保存到数据库
	 * @param array $data
	 * @return mixed
	 */
	public function update($data);

	/**
	 * 是否是超级管理员
	 *
	 * @param int $uid
	 * @return bool
	 */
	public function isAdministrator($uid = null);

	/**
	 * 销毁
	 */
	public function destroy();

}
